#ifndef __BPFPI146__
#define __BPFPI146__
#include <iostream>
#include <vector>
#include <string>


void foo(const char * str){
	char current = str[0];
	std::vector<std::pair<char ,int> > count;
	int cnt = 1;
	for(int i = 1; i< strlen(str); ++i){
		if(current == str[i]){
			cnt ++;
		}else{
			count.push_back(std::make_pair(current,cnt));
			cnt = 1;
			current = str[i];
		}
	}
	count.push_back(std::make_pair(current,cnt));
	std::vector<std::pair<char ,int> >::iterator it = count.begin();
	std::string a;
	for(;;){
		if(it == count.end()) break;
		a += it->first;
		char temp[10];
		a += itoa(it->second, temp, 10);
		it++;
	}
	std::cout << a;
}
#endif